/*    */ package com.yizhilu.os.image.util;
/*    */ 
/*    */ import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import java.io.File;
/*    */ public class DocConverter
/*    */ {
/*    */   private static final int environment = 2;
/* 15 */   private static Logger logger = LoggerFactory.getLogger(DocConverter.class);
/*    */ 
/*    */   public static String pdf2swf(String pdfName, String swfName)
/*    */     throws Exception
/*    */   {
/* 55 */     File pdfFile = new File(pdfName);
/* 56 */     File swfFile = new File(swfName);
/* 57 */     Runtime r = Runtime.getRuntime();
/* 58 */     if (!swfFile.exists()) {
/* 59 */       if (pdfFile.exists())
/*    */       {
/*    */         try
/*    */         {
/* 70 */           Process p = r.exec("/opt/swftools/bin/pdf2swf " + pdfName + " -o " + swfName + " -T 9");
/* 71 */           logger.info("swf转换成功，文件输出命令：/opt/swftools/bin/pdf2swf " + pdfName + " -o " + swfName + " -T 9");
/* 72 */           logger.info("swf转换成功，文件输出：" + swfName);
/*    */         } catch (Exception e) {
/* 74 */           e.printStackTrace();
/* 75 */           return "convererror";
/*    */         }
/*    */       }
/*    */       else
/* 79 */         return "pdfnotexists";
/*    */     }
/*    */     else {
/* 82 */       return "swfexists";
/*    */     }
/* 84 */     return "success";
/*    */   }
/*    */ 
/*    */   public static void main(String[] args)
/*    */   {
/*    */     try {
/* 90 */       String pfd = "E:/a.pdf";
/* 91 */       String swf = "E:/a.swf";
/* 92 */       pdf2swf(pfd, swf);
/*    */     } catch (Exception e) {
/* 94 */       e.printStackTrace();
/*    */     }
/*    */   }
/*    */ }

/* Location:           F:\work\公司\质量学院\ducumentQIN\项目更新\web\20171122\
 * Qualified Name:     com.yizhilu.os.image.util.DocConverter
 * JD-Core Version:    0.6.1
 */